<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>


<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Password Change</title>
<link rel="shortcut icon" href="images/idenewlogo.png">
</head>
<script type="text/javascript">
	function assignUserName(){
		//alert(document.getElementById("changePassForm:userid"));
		document.getElementById("changePassForm:hidUserName").value=document.getElementById("changePassForm:userid").innerHTML;
		//alert(document.getElementById("changePassForm:hidUserName").value);
	}
</script>
<body>
	  <h:form id="changePassForm">
	  <div align="center">
	  	<h:messages style="color:red"/>
	  	<h:panelGrid columns="2" cellpadding="2" cellspacing="2" border="3" style="align:center;background:silver;">
	  			
	  			<h:outputText value="Logged in User "/>
	  			<h:outputText value="#{userDetailsBean.username}" id="userid"/>
	  			
	  		    <h:outputText value="Old Password"/>
	  			<h:inputText value="#{changePassword.oldPassword}"/>
	  		    
	  		    <h:outputText value="New Password"/>
	  			<h:inputText value="#{changePassword.newPassword}"/>
	  		    
	  		    <h:outputText value="Re Enter Password"/>
	  			<h:inputText value="#{changePassword.reEnterNewpassword}"/>
	  			
	  		    <h:commandButton value="Change Password" action="#{changePassword.changeUserPassword}" onclick="assignUserName();"/>
	  		    <h:commandButton value="Cancel" action="#{changePassword.goToJavaIDE}"/>
	  			<h:inputHidden id="hidUserName" value="#{changePassword.hiddenUserName}"/>
	  			
	  	</h:panelGrid>
	  </div>	
	  </h:form>
	</body>
</html>
</f:view>